<!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<title>
			Document
		</title>
		<hdjs/>
		<js file="__CONTROLLER_VIEW__/js/js.js"/>
		<css file='__CONTROLLER_VIEW__/css/css.css'/>
	</head>
	<body>
		<div class="wrap">
			<div class="menu_list">
				<ul>
					<li>
						<a href="{|U:'index',array('gtid'=>$gtid)}"  class="action">
							属性列表
						</a>
					</li>
				</ul>
			</div>
			<div class="title-header" >
				添加商品类型
			</div>
			<form method="post" class="hd-form">
				<input type="hidden" name="aid" value="{$attr.aid}" />
				<input type="hidden" name='gtid' value="{$gtid}" />
				<table class="table1">
					<tr>
						<th class="w100">
							属性名称
						</th>
						<td>
							<input type="text" name='attr_name' class="w200" value="{$attr.attr_name}"/>
						</td>
					</tr>
					<tr>
						<th class="w100">
							规格属性
						</th>
						<td>
							<label>
								<input type="radio" name='spec' value='1' <if value='$attr.spec eq 1'>checked=""</if>/>
								是
							</label>
							<label>
								<input type="radio" name='spec' value='0' <if value='$attr.spec eq 0'>checked=""</if>/>
								否
							</label>
						</td>
					</tr>
					<tr>
						<th class="w100">
							显示方式
						</th>
						<td>
							<label>
								<input type="radio" name='show_type' value='text' <if value='$attr.show_type eq "text"'>checked=""</if> onclick='alterAttrType()'/>
								文本框
							</label>
							<label>
								<input type="radio" name='show_type' value='radio' <if value='$attr.show_type eq "radio"'>checked=""</if> onclick='alterAttrType()'/>
								单选
							</label>
							<label>
								<input type="radio" name='show_type' value='checkbox' <if value='$attr.show_type eq "checkbox"'>checked=""</if> onclick='alterAttrType()'/>
								多选
							</label>
							<label>
								<input type="radio" name='show_type' value='select' <if value='$attr.show_type eq "select"'>checked=""</if> onclick='alterAttrType()'/>
								下拉列表
							</label>
						</td>
					</tr>
					<tr>
						<th>
							属性值
						</th>
						<td>
							<table class="table1" id='attrList'>
								<list from="$attr_value" name='a'>
								<tr>
									<td>
										<input type="text" name='av_value[]' class="w200" value='{$a.av_value}'/>
										<input type="hidden" name='avid[]' value='{$a.avid}'/>
										<if value="$hd.list.a.index gt 1">
											<button class="hd-cancel" type="button" onclick="delAttrTr(this)">删除</button>
										</if>
										<button class="hd-cancel" type='button' id='addAttr' onclick="addAttrTr(this)">
											添加
										</button>
									</td>
								</tr>
								</list>
							</table>
						</td>
					</tr>
				</table>
				<div class="position-bottom">
					<input type="submit" class="hd-success" />
				</div>
			</form>
		</div>
		<script>$('form').validate({
	gt_name: {
		rule: {
			required: true
		},
		error: {
			required: '不能为空'
		}
	}
})</script>
	</body>
</html>
